package ooday03;

import ooday03.animal.Chick;
import ooday03.animal.Dog;
import ooday03.animal.Flsh;

public class RefArrayDemo {


    public static void main(String[] args) {
        Dog[] dogs = new Dog[3];
        Chick[] chicks = new Chick[3];
        Flsh[] flshs = new Flsh[3];
        dogs[0] = new Dog("xia",12,"xiang");
        dogs[1] = new Dog("hua",15,"lan");
        dogs[2] = new Dog("a",1,"c");


        chicks[0] = new Chick("hie",3,"gon");
        chicks[1] = new Chick("lv",2,"zhu");
        chicks[2] = new Chick("hun",1,"ji");


        flshs[0] = new Flsh("xia",12,"xiang");
        flshs[1] = new Flsh("hua",15,"lan");
        flshs[2] = new Flsh("a",1,"c");


        for (int i = 0; i < dogs.length; i++) {
            dogs[i].swim();
        }

        for (int i = 0; i < flshs.length; i++) {
            flshs[i].swim();
        }

        for (int i = 0; i < chicks.length; i++) {
            chicks[i].layEggs();
        }


    }

}
